//
//  TTOpenPlusSuccessViewController.m
//  TaoTuo
//
//  Created by admin on 2019/11/13.
//  Copyright © 2019 admin. All rights reserved.
//

#import "TTOpenPlusSuccessViewController.h"
#import "TTDianpuManagerViewController.h"

@interface TTOpenPlusSuccessViewController ()

@end

@implementation TTOpenPlusSuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"支付结果";
    
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"paysuccess"]];
    [self.view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_topLayoutGuideBottom).mas_offset(50);
        make.centerX.equalTo(self.view);
    }];
    
    UILabel *label = [UILabel labelWithTitle:@"开通成功" color:[UIColor blackColor] fontSize:18];
    [self.view addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(imageView.mas_bottom).mas_offset(21);
        make.centerX.equalTo(self.view);
    }];
    
    UIButton *btn = [UIButton createButtonWithTitle:@"进入个人品牌商城" titleColor:[UIColor whiteColor] titleFont:[UIFont systemFontOfSize:16] backgroundColor:kMainColor cornerRadius:15 target:self action:@selector(lookDianpu)];
    btn.contentEdgeInsets = UIEdgeInsetsMake(6, 15, 6, 15);
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(label.mas_bottom).mas_offset(25);
        make.centerX.equalTo(self.view);
        make.height.mas_equalTo(30);
    }];
    
}

- (void)lookDianpu
{
    TTDianpuManagerViewController *dianpuVC = [[TTDianpuManagerViewController alloc] init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:dianpuVC];
    nav.modalPresentationStyle = UIModalPresentationFullScreen;
    [self presentViewController:nav animated:YES completion:nil];
    
    [self.navigationController popToRootViewControllerAnimated:YES];
}

@end
